package com.njmd.mdbs.web.entity.sys;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * 系统角色菜单实体
 * @author sunqw
 * @since 2013.10.12
 */
@Entity
@Table(name = "SYS_ROLE_PERMISSION")
public class SysRolePermission implements Serializable
{
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "ID")
	private Long id;

	// bi-directional many-to-one association to SysPermission
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "PERMISSION_ID")
	private SysPermission sysPermission;

	// bi-directional many-to-one association to SysRole
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "ROLE_ID")
	private SysRole sysRole;

	@Column(name="PRIVILEGE")
	private String privilege;
	
	public String getPrivilege() {
		return privilege;
	}

	public void setPrivilege(String privilege) {
		this.privilege = privilege;
	}

	public SysRolePermission()
	{
	}

	public Long getId()
	{
		return id;
	}

	public void setId(Long id)
	{
		this.id = id;
	}

	public SysPermission getSysPermission()
	{
		return sysPermission;
	}

	public void setSysPermission(SysPermission sysPermission)
	{
		this.sysPermission = sysPermission;
	}

	public SysRole getSysRole()
	{
		return sysRole;
	}

	public void setSysRole(SysRole sysRole)
	{
		this.sysRole = sysRole;
	}

}